import java.util.*;
import java.io.*;
//快读
class Read {
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String next() throws IOException {
        while(!st.hasMoreTokens()) {
            st = new StringTokenizer(bf.readLine());
        }
        return st.nextToken();
    }
    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
}
//dd爱框框
public class code2 {
    public static void main(String[] args) throws IOException{
        Read sc = new Read();
        int n = sc.nextInt(),x = sc.nextInt();
        int[] arr = new int[n+1];
        for(int i=1;i<=n;i++) {
            arr[i] = sc.nextInt();
        }
        int left=0,right=0,sum=0;
        int retLeft=-1,retRight=-1,retLen=n;

        while(right<=n) {
            //进窗口
            sum+=arr[right];
            while(sum>=x) {
                //更新结果
                if(right-left+1<retLen) {
                    retLeft = left;
                    retRight = right;
                    retLen = right-left+1;
                }
                sum-=arr[left++];//出窗口
            }
            right++;
        }
        System.out.println(retLeft+" "+retRight);

    }
}